//package com.axxc.jpa.web;
//
//import java.io.IOException;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import com.qq.connect.QQConnectException;
//import com.qq.connect.api.OpenID;
//import com.qq.connect.api.qzone.UserInfo;
//import com.qq.connect.javabeans.qzone.UserInfoBean;
//import com.qq.connect.oauth.Oauth;
//
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//
///** 
// * @ClassName: QQController 
// * @Description: TODO(这里用一句话描述这个类的作用) 
// * @author xxc
// * @date 2018年7月19日 下午4:18:34  
// */
//
//@RestController
//@RequestMapping("QQ")
//@Api(value = "用户QQ", tags = { "QQ操作接口" })
//public class QQController {
//
//	private final Logger logger = LoggerFactory.getLogger(getClass());
//	
//	
//	@GetMapping("index")
//	@ApiOperation(value = "QQ授权登录页面")
//	public void index(HttpServletRequest request, HttpServletResponse resp) {
//		resp.setContentType("text/html;charset=utf-8");
//		try {
//			resp.sendRedirect(new Oauth().getAuthorizeURL(request));
//		} catch (IOException e) {
//			logger.error("error", e);
//		} catch (QQConnectException e) {
//			logger.error("error", e);
//		}
//
//	}
//	
//	@GetMapping("afterLogin")
//	public UserInfoBean afterLogin(HttpServletRequest request,String accessToken,String openID ) throws QQConnectException{
//			request.getSession().setAttribute("access_token", accessToken);
//			OpenID openIDObj = new OpenID(accessToken);
//			openID = openIDObj.getUserOpenID();
//			UserInfo qzoneUserInfo = new UserInfo(accessToken, openID);
//			UserInfoBean userInfoBean = qzoneUserInfo.getUserInfo();
//			return userInfoBean ;
//	}
//	
//	
//	
//}
